<% layout('/layouts/default.html', {title: '任务维权管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('任务维权管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('tk:tkTaskWeiquan:edit')){ %>
					<a href="${ctx}/tk/tkTaskWeiquan/form" class="btn btn-default btnTool" title="${text('新增任务维权')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${tkTaskWeiquan}" action="${ctx}/tk/tkTaskWeiquan/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('任务工单号')}：</label>
					<div class="control-inline">
						<#form:input path="code" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('维权类型')}：</label>
					<div class="control-inline">
						<#form:input path="weiquanType" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('任务ID')}：</label>
					<div class="control-inline">
						<#form:input path="myTaskId" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('申请人')}：</label>
					<div class="control-inline">
						<#form:input path="userId" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('维权原因')}：</label>
					<div class="control-inline">
						<#form:input path="failExplain" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('上传图片')}：</label>
					<div class="control-inline">
						<#form:input path="pics" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('申请时间')}：</label>
					<div class="control-inline">
						<#form:input path="createTime" readonly="true" maxlength="20" class="form-control laydate width-datetime"
							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('1 用户申诉 2平台处理结果  3用户接单')}：</label>
					<div class="control-inline">
						<#form:input path="shensuStatus" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('liucheng')}：</label>
					<div class="control-inline">
						<#form:input path="liucheng" class="form-control width-120"/>
					</div>
				</div>

				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("工单编号")}', name:'code', index:'a.code', width:150, align:"left", frozen:true},
		{header:'${text("维权类型")}', name:'weiquanType', index:'a.weiquan_type', width:150, align:"left"},
		{header:'${text("申请人")}', name:'userId', index:'a.user_id', width:150, align:"left"},
		{header:'${text("维权原因")}', name:'failExplain', index:'a.fail_explain', width:150, align:"left"},
		{header:'${text("申诉图片")}', name:'pics', index:'a.pics', width:450, align:"center", formatter: function(val, obj, row, act){
			var arr = JSON.parse(val);
			var html = "";
			console.log(arr);
			for (let i = 0; i < arr.length; i++) {
				let arrElement = arr[i];
				html+='<img src="'+arrElement+'" width="50" height="50"/>';
			}
			console.log(html);
			return html;
		}},
		{header:'${text("申请时间")}', name:'createTime', index:'a.create_time', width:150, align:"center"},
		{header:'${text("工单状态")}', name:'shensuStatus', index:'a.shensu_status', width:150, align:"left", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('weiquan_status')}, val, '${text("未知")}', true);
		}},
		// {header:'${text("liucheng")}', name:'liucheng', index:'a.liucheng', width:150, align:"left"},
		// {header:'${text("裁定时间")}', name:'caidingTime', index:'a.caiding_time', width:150, align:"center"},
		// {header:'${text("裁定状态")}', name:'myTaskStatus', index:'a.my_task_status', width:150, align:"left"},
		// {header:'${text("裁定图片路径")}', name:'caidingPics', index:'a.caiding_pics', width:150, align:"left"},
		// {header:'${text("裁定说明")}', name:'caidingExplain', index:'a.caiding_explain', width:150, align:"left"},
		{header:'${text("操作")}', name:'actions', width:220, formatter: function(val, obj, row, act){
			var actions = [];
			// actions.push('<a href="${ctx}/tk/tkTask/taskInfo?id='+row.id+'" class="" title="${text("详情")}">项目详情</a>&nbsp;');
			actions.push('<a href="${ctx}/tk/tkMyTask/tkMyTaskInfo?weiquanId='+row.id+'&id='+row.myTaskId+'" class="btnList" title="${text("交单详情")}">交单详情</a>&nbsp;');

			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>
<script>
	function jiaodan(id){

	}
</script>